<template>
  <div class="ele-body ele-body-card">
    <el-row :gutter="15">
      <el-col
        v-bind="styleResponsive ? { lg: 17, md: 24, sm: 24 } : { span: 24 }"
      >
        <el-row :gutter="15">
          <el-col
            v-bind="styleResponsive ? { lg: 11, md: 11, sm: 24 } : { span: 11 }"
          >
            <statistics-card />
          </el-col>
          <el-col
            v-bind="styleResponsive ? { lg: 13, md: 13, sm: 24 } : { span: 6 }"
          >
            <sale-card />
          </el-col>
        </el-row>

        <el-row :gutter="15">
          <el-col
            v-bind="styleResponsive ? { lg: 24, md: 24, sm: 24 } : { span: 24 }"
          >
            <visit-hour />
          </el-col>
        </el-row>
      </el-col>
      <el-col
        v-bind="styleResponsive ? { lg: 7, md: 24, sm: 24 } : { span: 24 }"
      >
        <hot-search />
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import StatisticsCard from './components/statistics-card.vue';
  import SaleCard from './components/sale-card.vue';
  import VisitHour from './components/visit-hour.vue';
  import HotSearch from './components/hot-search.vue';
  import { selectPiratesite } from '@/api/updateVersion/index';
  export default {
    name: 'DashboardAnalysis',
    components: {
      StatisticsCard,
      SaleCard,
      VisitHour,
      HotSearch
    },
    computed: {
      // 是否开启响应式布局
      styleResponsive() {
        return this.$store.state.theme.styleResponsive;
      }
    },
    // 路由刷新
    activated() {
      this.init();
    },
    methods: {
      async init() {
        const res = await selectPiratesite();
      }
    }
  };
</script>
